package com.hyq.service.impl;


import com.hyq.mapper.SUserDAO;
import com.hyq.model.SUser;
import com.hyq.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class StudentServiceImpl  implements StudentService {
	
	@Autowired
	private SUserDAO dao;
	
	@Override
	public boolean validateName(String name) {
		if(dao.validateName(name) > 0){
			return false;
		}else{
			return true;
		}
		
	}
	
	@Override
	public SUser sLogin(SUser su) {
		return dao.sLogin(su);
		
	}
	
	@Override
	public int sRegister(SUser su) {

		return dao.sRegister(su);
	}
	
	@Override
	public int cOldPassword(String password, int sid) {
		
		return dao.cOldPassword(password, sid);
	}
	
	@Override
	public int updatePassword(String password, int sid) {
		
		return dao.updatePassword(password, sid);
	}
	
	@Override
	public int supdate(SUser su) {
		
		return dao.supdate(su);
	}
	
	@Override
	public SUser ssearchById(int sid) {
		
		return dao.ssearchById(sid);
	}
	
	@Override
	public int updateSname(String sname, int sid) {
		
		return dao.updateSname(sname, sid);
	}
	
	@Override
	public int sBatchDelete(String[] arr) {
		
		return dao.sBatchDelete(arr);
	}
	
	@Override
	public List<SUser> sSearch(String keyword) {
		
		return dao.sSearch(keyword);
	}
	
	
	@Override
	public List<SUser> sUpdate(int sid) {
		
		return dao.sUpdate(sid);
	}
}
